package Final;

import java.util.Scanner;
public class test26{
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int no = scan.nextInt();
        String name = scan.next();
        String sex = scan.next();
        Student s = new Student(no, name, sex);
        s.print();

        no = scan.nextInt();
        name = scan.next();
        sex = scan.next();
        String major = scan.next();
        CollegeStudent c = new CollegeStudent(no, name, sex, major);
        c.print();

        no = scan.nextInt();
        name = scan.next();
        sex = scan.next();
        major = scan.next();
        String supervisor = scan.next();
        GraduateStudent g = new GraduateStudent(no, name, sex, major, supervisor );
        g.print();
        g.doResearch();
        scan.close();
    }
}

/* 你的代码被嵌在这里*/
class Student{
    int no;
    String name;
    String sex;
    public void print(){
        System.out.println("no: " + no);
        System.out.println("name: " + name);
        System.out.println("sex: " + sex);
    }

    public Student(int no, String name, String sex) {
        this.no = no;
        this.name = name;
        this.sex = sex;
    }

    public int getNo() {
        return no;
    }

    public void setNo(int no) {
        this.no = no;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }
    public void attendClass(String className){
        System.out.println("正在上课");
    }
}
class CollegeStudent extends Student{
    String major;

    public CollegeStudent(int no, String name, String sex, String major) {
        super(no, name, sex);
        this.major = major;
    }

    public String getMajor() {
        return major;
    }

    public void setMajor(String major) {
        this.major = major;
    }

    @Override
    public void print() {
        super.print();
        System.out.print("major: " + major);
    }
}
class GraduateStudent extends CollegeStudent{
    String supervisor;

    public String getSupervisor() {
        return supervisor;
    }

    public void setSupervisor(String supervisor) {
        this.supervisor = supervisor;
    }

    public GraduateStudent(int no, String name, String sex, String major, String supervisor) {
        super(no, name, sex, major);
        this.supervisor = supervisor;
    }
    public void doResearch() {
        System.out.println(name + "is doing research");
    }

    @Override
    public void print() {
        super.print();
        System.out.println();
        System.out.println("supervisor: " + supervisor);
    }
}